package com.treetao.union.db.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.treetao.union.db.mapper.MallCartMapper;
import com.treetao.union.db.model.MallCart;
import com.treetao.union.db.service.MallCartService;

/**
 * <p>
 * 购物车 服务实现类
 * </p>
 *
 * @author Dev.M
 * @since 2020-04-11
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MallCartServiceImpl extends ServiceImpl<MallCartMapper, MallCart> implements MallCartService {

	@Override
	public boolean removeUserCart(Long userId, Object[] skuIds) {
		QueryWrapper<MallCart> q = new QueryWrapper<MallCart>();
		q.eq("ref_user_id", userId);
		q.in("ref_sku_id", skuIds);
		return remove(q);
	}

}
